package org.tigris.subversion.svnant.commands;

import java.io.File;
import org.tigris.subversion.svnant.SvnAntUtilities;
import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
import org.tigris.subversion.svnclientadapter.SVNClientException;
import org.tigris.subversion.svnclientadapter.SVNUrl;

public class Import extends SvnCommand
{
  private static final String MSG_CANT_IMPORT = "Can't import";
  private static final String MSG_CANT_MAKE_DIR = "Can't make dir %s";
  private SVNUrl url = null;
  private File path = null;
  private String message = null;
  private boolean recurse = true;
  private String newentry = null;

  public void execute()
  {
    try
    {
      SVNUrl localSVNUrl = this.url;
      if (this.newentry != null)
        try
        {
          localSVNUrl = this.url.appendPath(this.newentry);
          getClient().mkdir(localSVNUrl, this.message);
        }
        catch (SVNClientException localSVNClientException2)
        {
          throw ex(localSVNClientException2, "Can't make dir %s", new Object[] { this.url });
        }
      getClient().doImport(this.path, localSVNUrl, this.message, this.recurse);
    }
    catch (SVNClientException localSVNClientException1)
    {
      throw ex(localSVNClientException1, "Can't import", new Object[0]);
    }
  }

  protected void validateAttributes()
  {
    SvnAntUtilities.attrNotNull("url", this.url);
    SvnAntUtilities.attrNotNull("path", this.path);
    SvnAntUtilities.attrNotEmpty("message", this.message);
  }

  public void setUrl(SVNUrl paramSVNUrl)
  {
    this.url = paramSVNUrl;
  }

  public void setPath(File paramFile)
  {
    this.path = paramFile;
  }

  public void setMessage(String paramString)
  {
    this.message = paramString;
  }

  public void setRecurse(boolean paramBoolean)
  {
    this.recurse = paramBoolean;
  }

  public void setNewEntry(String paramString)
  {
    this.newentry = paramString;
    if ((this.newentry != null) && (this.newentry.trim().length() == 0))
      this.newentry = null;
  }
}

/* Location:           C:\Users\Administrator\Desktop\svnant.jar
 * Qualified Name:     org.tigris.subversion.svnant.commands.Import
 * JD-Core Version:    0.6.0
 */